<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/includes/common-import.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>${systemName}</title>
<link href="${resPath}main/css/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="${resPath}main/js/label.js"></script>
<script type="text/javascript" src="${resPath}main/js/jquery-1.8.3.min.js"></script>  
<script type="text/javascript">
    function assess(code,teacherId,examDateId){
    	$("#examCode").val(code);
    	$("#teacherId").val(teacherId);
    	$("#examDateId").val(examDateId);
     	 var form = document.getElementById("searchForm");
		 form.action = "${basePath }teacherExamResult/assess";
		 form.submit();

	}
    function searchByPram(){
    	 var form = document.getElementById("searchForm");
		 form.action = "${basePath }teacherExamResult";
		 form.submit();
    }
 </script>
</head>

<body>
<%@ include file="/WEB-INF/includes/indexHeader.jsp"%>
<DIV id="min_box" style="margin-top: 10px;">
<form id="searchForm" class="form-horizontal" method="post" style="margin-left: 200px;margin-top: 20px;margin-bottom: 30px;">
	<input type="hidden" name="code" id="examCode" />
	<input type="hidden" name="teacherId" id="teacherId"/>
	<input type="hidden" name="examDateId" id="examDateId"/>
	
	<div class="portlet">
		<div class="portlet-title">
			<div class="input-prepend input-append" style="color: white;">
				<span class="add-on"><i class="icon-search"></i></span>
				所属期间:  
				<select id="examDate" name="map['examDate']">
			   			<option></option>
				   		<c:forEach items="${listExam }" var="listExam">
				   			<option value="${listExam.id }">${listExam.description }</option>
				   		</c:forEach>
			   		</select>
			   		教师姓名:
					<input class="m-wrap placeholder-no-fix" type="text" 
						placeholder="按教师名称查询..." id="teacherName" name="map['teacherName']" value="${searchParams.map['teacherName'] }"/>
					<button type="button" class="ts_log_btn_small" onclick="searchByPram();">查询</button> 
				</div>
			</div>
		</div>
		<br />
		<table id="DG_Term" style="border: 2px solid rgb(53, 153, 153); width: 80%; color: black; border-collapse: collapse; background-color: white;" border="2" rules="cols" cellspacing="1" cellpadding="3">
		<thead>
			<tr style="color: white; font-weight: bold; background-color: rgb(46, 65, 120);">
				<th style="width:40px;">序号</th>
				<th>考核期间</th> 
				<th>评价教师</th> 
				<th>填报评价</th> 
				<th>完成情况</th> 
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${list}" var="list" varStatus="status">
				<tr class="odd gradeX">
					<td>${status.index+1 }</td>
					<td>${list.examDate.startdate }--${list.examDate.enddate }</td> 
					<td>${list.teacher.teacherName }</td> 
					<td align="center">
						<c:if test="${list.alreadyAssess==0}" >
						     <c:if test="${list.passTime==1}" >
						     <button type="button" class="ts_log_btn_small" onclick="assess('${list.batchId}',${list.teacher.id},${list.examDate.id });">评价</button> 
					     	 </c:if>
					     	  <c:if test="${list.passTime==0}" >
					     			<c:out value="不在期间内"></c:out>
					     	 </c:if>
						</c:if> 
						<c:if test="${list.alreadyAssess==1}" >
						     <c:out value="已经评价"></c:out>
						</c:if>
					</td> 
					<td>
					    <c:if  test="${list.alreadyAssess==1}" >
					       			已经填报
					    </c:if>
					     <c:if test="${list.alreadyAssess==0}"  >
					       			未填报
					    </c:if>
					</td> 
				</tr>
			</c:forEach>
			</tbody>
	</table>
	<p:page url="teacherExamResult" cpage="${page.cpage }" perItem="${page.perItem }" totalItem="${page.totalItem }"/>
</form>
</DIV>
<%@ include file="/WEB-INF/includes/indexFooter.jsp"%>
</body>
</html>